#!/bin/sh

if [ "$1" = "" -o "$2" = "" ]; then
    echo 'Please use the following command'
    echo 'putty.sh ib04b01 ib04b02'
    exit 1
fi 

_TEMPLATENAME=$1
_TARGETNAME=$2

REG COPY 'HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\'$_TEMPLATENAME 'HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\'$_TARGETNAME /f /s
REG ADD 'HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\'$_TARGETNAME /v HostName /t REG_SZ /d $_TARGETNAME /f
REG ADD 'HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\'$_TARGETNAME /v WinTitle /t REG_SZ /d $_TARGETNAME /f
